-
Notifications
You must be signed in to change notification settings - Fork 55
feat(theming): exporting slot's classNames form components #827
Conversation
src/components/Layout/Layout.tsx
Outdated
startArea && 'ui-layout--reduced__start', | ||
mainArea && 'ui-layout--reduced__main', | ||
endArea && 'ui-layout--reduced__end', | ||
startArea && Layout.slotClassNames.reducedStart, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the right convention, as the className here is changed because of a prop...
@@ -175,8 +187,8 @@ class ItemLayout extends UIComponent<ReactProps<ItemLayoutProps>, any> { | |||
const mainArea = renderMainArea(this.props, this.state, classes) | |||
const endArea = endMedia | |||
|
|||
const mergedMediaClasses = cx('ui-item-layout__media', classes.media) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups, breaking changes introduced. It seems that the classNames of this slots were not correct...
Codecov Report
@@ Coverage Diff @@
## master #827 +/- ##
=======================================
Coverage 93.54% 93.54%
=======================================
Files 21 21
Lines 728 728
Branches 73 73
=======================================
Hits 681 681
Misses 47 47 Continue to review full report at Codecov.
|
CHANGELOG.md
Outdated
@@ -17,8 +17,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm | |||
|
|||
## [Unreleased] | |||
|
|||
### BREAKING CHANGES | |||
- Renamed classNames for the slots inside the `ItemLayout` component @mnajdova ([#827](https://github.com/stardust-ui/react/pull/827)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets do either 'class names' or 'className
s'. I would suggest the first option, as it is more correct and implementation agnostic :)
CHANGELOG.md
Outdated
### Features | ||
- Accessibility for menu divider @jurokapsiar ([#822](https://github.com/stardust-ui/react/pull/822)) | ||
- Added slotClassNames in `ChatMessage`, `ChatItem`, `Dropdown`, `ItemLayout`, `Layout`, `MenuItem` @mnajdova ([#827](https://github.com/stardust-ui/react/pull/827)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would suggest just 'slot class names'
# Conflicts: # CHANGELOG.md
This PR fixes #784 by adding slotClassNames static fields int he component which have already specified some custom classNames for the slots.
BREAKING CHANGES
The classNames for the slots in the ItemLayout component have been renamed. Please replace the following selectors accordingly:
Question
Do we want to introduce slot's classes for the slots inside the component which are created with the Box or Text component? It seems reasonable to me, as these components can be heavily used in the content of the components, so selecting the slot's containers might be tricky... On the other hand, they can be styled via the slot's inside the component styles, but still creating selectors for them if necessary can be tricky.. Let me know what you think!
Decision
We will add them if there is requirement from the users.